//
//  OrderSubmitStateViewController.m
//  OMS
//
//  Created by goldeney on 14-10-11.
//  Copyright (c) 2014年 ShangHai Goldeneye Techonology Co.,Ltd. All rights reserved.
//

#import "CRECOMOrderSubmitSuccessYJController.h"
#import "CRECJCOrderListYJController.h"
#import "NSDictionary+DataFormat.h"

@interface CRECOMOrderSubmitSuccessYJController ()

@property (nonatomic,strong) NSDictionary *orderResult;

@end

@implementation CRECOMOrderSubmitSuccessYJController

-(id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        [self setTitle: @"浇筑令提交结果"];
    }
    return self;
}

- (void)getPassingParameter:(id)object
{
    NSDictionary *result = object;
    self.orderResult = result;
    
    self.orderNumLabel.text = [result objectFormatStringForKey:@"订单编号" defaults:@"未知"];
    self.projectNameLabel.text = [result objectFormatStringForKey:@"工程名称" defaults:@"未知"];
    self.constructionLabel.text = [result objectFormatStringForKey:@"施工部位" defaults:@"未知"];
    self.jhflLabel.text = [result objectFormatStringForKey:@"计划方量" format:@"%@立方" defaults:@"未知"];
    self.jhkpsjLabel.text = [result objectFormatStringForKey:@"计划开盘时间" defaults:@"未知"];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    self.extendedLayoutIncludesOpaqueBars = NO;
    self.edgesForExtendedLayout = UIRectEdgeBottom | UIRectEdgeLeft | UIRectEdgeRight;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark -
#pragma mark IBAction Event

- (IBAction)checkOrderButtonEvent:(id)sender
{
    CRECJCOrderListYJController *viewController = [[CRECJCOrderListYJController alloc] init];
    [self.navigationController pushViewController:viewController animated:YES];
}

- (IBAction)gonoCreateOrderButtonEvent:(id)sender
{
    MainAppDelegate *mDelegate = (MainAppDelegate*)[[UIApplication sharedApplication] delegate];
    NSArray *viewControllers = mDelegate.navigationController.viewControllers;
    UIViewController *closeController = [viewControllers objectAtIndex:viewControllers.count - 3];
    [mDelegate.navigationController popToViewController:closeController animated:YES];
}

- (void)backButtonEvent:(id)sender
{
    MainAppDelegate *mDelegate = (MainAppDelegate*)[[UIApplication sharedApplication] delegate];
    NSArray *viewControllers = mDelegate.navigationController.viewControllers;
    UIViewController *closeController = [viewControllers objectAtIndex:viewControllers.count - 4];
    [mDelegate.navigationController popToViewController:closeController animated:YES];
}

@end
